package BehavioralPattern.ChainOfResp;

/**
 * @Classname : ConcreteRequest
 * @Description : 具体请求者
 * @Author : chentianyu
 * @Date 2023/3/5 11:12
 */


public class ConcreteRequest implements Request {

    private String name;  // 请假人
    private int days;  // 请假天数

    public ConcreteRequest(String name, int days) {
        this.name = name;
        this.days = days;
    }


    @Override
    public int getType() {
        return this.days;
    }

    @Override
    public void request(Handler handler) {
        System.out.println(this.name + "因家中有事发起请假请求");
        handler.handleRequest(this);
    }
}
